<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>业务数据表管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function() {
            
        });
        function page(n,s){
            $("#pageCurrent").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
    <ul class="nav nav-tabs">
        <li class="active"><a href="${ctx}/test/testData/">业务数据表列表</a></li>
        <shiro:hasPermission name="test:testData:edit">
            <li><a href="${ctx}/test/testData/form">业务数据表添加</a></li>
        </shiro:hasPermission>
    </ul>
    <form:form id="searchForm" modelAttribute="testData" action="${ctx}/test/testData/" method="post" class="breadcrumb form-search">
        <input id="pageCurrent" name="pageCurrent" type="hidden" value="${page.current}"/>
        <input id="pageSize" name="pageSize" type="hidden" value="${page.size}"/>
        <ul class="ul-form">
            <li><label>归属用户：</label>
                <sys:treeselect id="userId" name="userId" value="${userId}" labelValueUrl="/sys/sysUser/treeValue"
                    title="用户" url="/sys/sysOffice/treeData?type=3" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
            </li>
            <li><label>归属部门：</label>
                <sys:treeselect id="officeId" name="officeId" value="${officeId}" labelValueUrl="/sys/sysOffice/treeValue"
                    title="机构" url="/sys/sysOffice/treeData?type=2" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
            </li>
            <li><label>归属区域：</label>
                <sys:treeselect id="areaId" name="areaId" value="${areaId}" labelValueUrl="/sys/area/treeValue"
                    title="区域" url="/sys/area/treeData" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
            </li>
            <li><label>名称：</label>
                <form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
            </li>
            <li><label>性别：</label>
                <form:input path="sex" htmlEscape="false" maxlength="1" class="input-medium"/>
            </li>
            <li><label>加入日期：</label>
                <input name="inDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
                    value="<fmt:formatDate value="${testData.inDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
            </li>
            <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
            <li class="clearfix"></li>
        </ul>
    </form:form>
    <sys:message content="${message}"/>
    <table id="contentTable" class="table table-striped table-bordered table-condensed">
        <thead>
            <tr>
                <th>编号</th>
                <th>归属用户</th>
                <th>归属部门</th>
                <th>归属区域</th>
                <th>名称</th>
                <th>性别</th>
                <th>加入日期</th>
                <shiro:hasPermission name="test:testData:edit">
                    <th>操作</th>
                </shiro:hasPermission>
            </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.records}" var="testData">
            <tr>
                <td>
                    <a href="${ctx}/test/testData/form?id=${testData.id}">
                    ${testData.id}
                    </a>
                </td>
                <td>
                    ${fns:getUserNameById(testData.userId)}
                </td>
                <td>
                    ${fns:getOfficeNameById(testData.officeId)}
                </td>
                <td>
                    ${fns:getAreaNameById(testData.areaId)}
                </td>
                <td>
                    ${testData.name}
                </td>
                <td>
                    ${testData.sex}
                </td>
                <td>
                    <fmt:formatDate value="${testData.inDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                </td>
                <shiro:hasPermission name="test:testData:edit">
                    <td>
                        <a href="${ctx}/test/testData/form?id=${testData.id}">修改</a>
                        <a href="${ctx}/test/testData/delete?id=${testData.id}" onclick="return confirmx('确认要删除该业务数据表吗？', this.href)">删除</a>
                    </td>
                </shiro:hasPermission>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="pagination">${page}</div>
</body>
</html>